package jsyf.oa.entity.psi;

import com.alibaba.fastjson.JSONObject;

import javax.persistence.Entity;
import javax.persistence.Table;

import jsyf.oa.ientity.BaseEntity;

/**
 * Created by Maqiuqiu on 2018/10/17.
 */
@Entity
@Table(name = "t_psi_inventory", schema = "oa", catalog = "")
public class InventoryEntity extends BaseEntity {

    private String goodsId;
    private String unit;
    private String requirements;
    private String address;
    private Integer count;
    private String price;
    private String state;
    private String createUserId;
    private String purchaseId;
    private String repoInOutId;
    private String extra;

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getPurchaseId() {
        return purchaseId;
    }

    public void setPurchaseId(String purchaseId) {
        this.purchaseId = purchaseId;
    }

    public String getRepoInOutId() {
        return repoInOutId;
    }

    public void setRepoInOutId(String repoInOutId) {
        this.repoInOutId = repoInOutId;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getRequirements() {
        return requirements;
    }

    public void setRequirements(String requirements) {
        this.requirements = requirements;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getExtra() {
        return extra;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", getId());
        obj.put("GOODS_ID", getGoodsId());
        obj.put("REQUIREMENTS", getRequirements());
        obj.put("ADDRESS", getAddress());
        obj.put("COUNT", getCount());
        obj.put("PRICE", getPrice());
        obj.put("UNIT", getUnit());
        obj.put("STATE", getState());
        obj.put("PURCHASE_ID", getPurchaseId());
        obj.put("REPO_IN_OUT_ID", getRepoInOutId());
        obj.put("EXTRA", getExtra());
        obj.put("CREATE_USER_ID", getCreateUserId());
        obj.put("CREATE_TIME", getCreateTime());
        obj.put("UPDATE_USER_ID", getUpdateUserId());
        obj.put("UPDATE_TIME", getUpdateTime());
        return obj;
    }

    @Override
    public String getTableName() {
        return "t_psi_inventory";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("GOODS_ID", "goodsId");
        obj.put("REQUIREMENTS", "requirements");
        obj.put("ADDRESS", "address");
        obj.put("COUNT", "count");
        obj.put("PRICE", "price");
        obj.put("UNIT", "unit");
        obj.put("STATE", "state");
        obj.put("PURCHASE_ID", "purchaseId");
        obj.put("REPO_IN_OUT_ID", "repoInOutId");
        obj.put("EXTRA", "extra");
        obj.put("CREATE_USER_ID", "createUserId");
        obj.put("CREATE_TIME", "createTime");
        obj.put("UPDATE_USER_ID", "updateUserId");
        obj.put("UPDATE_TIME", "updateTime");
        return obj;
    }

}
